//
//  AmericaSongCell.m
//  Coco_Music
//
//  Created by 强哥 on 15/6/24.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "AmericaSongCell.h"

@implementation AmericaSongCell

-(void)dealloc
{
    [self.SongLabel release];
    [self.SingerLabel release];
    [self.song release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creation];
    }
    return self;
}

-(void)creation
{
    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(self.frame.origin.x+20, self.frame.origin.y+20, [UIScreen mainScreen].bounds.size.width/8, [UIScreen mainScreen].bounds.size.width/8)];
    image.image = [UIImage imageNamed:@"dts_accessory_over_ear_chosen"];
    
    self.SongLabel = [[UILabel alloc]initWithFrame:CGRectMake(image.frame.size.width+50, self.frame.origin.y+20, self.frame.size.width-100, 30)];
    self.SongLabel.font =[UIFont fontWithName:@"Menlo-Bold" size:17];
    
    self.SingerLabel = [[UILabel alloc]initWithFrame:CGRectMake(_SongLabel.frame.origin.x, _SongLabel.frame.origin.y+35, self.frame.size.width-100, 30)];
    self.SingerLabel.textColor = [UIColor lightGrayColor];
    
    [self.contentView addSubview:image];
    [self.contentView addSubview:_SongLabel];
    [self.contentView addSubview:_SingerLabel];
    [self.SongLabel release];
    [self.SingerLabel release];
    
}

-(void)setSong:(NewSong *)song
{
    if (_song != song) {
        [_song release];
        _song = [song retain];
    }
    self.SongLabel.text = song.song_name;
    self.SingerLabel.text = song.singer_name;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
